

  Polymer('context-free-parser', {

    text: null,

    textChanged: function() {
      if (this.text) {
        var entities = ContextFreeParser.parse(this.text);
        if (!entities || entities.length === 0) {
          entities = [
            {name: this.url.split('/').pop(), description: '**Undocumented**'}
          ];
        }
        this.data = { classes: entities };
      }
    },

    dataChanged: function() {
      this.fire('data-ready');
    }

  });

